package main

type Queue[T any] struct {
	elements []T
}

func (q *Queue[T]) pop() (T, bool) {
	var val T
	if q.size() == 0 {
		return val, false
	}
	val = q.elements[0]
	q.elements = q.elements[1:]

	return val, true

}

func (q *Queue[T]) push(elem T) bool {
	q.elements = append(q.elements, elem)
	return true
}

func (q *Queue[T]) size() int {
	return len(q.elements)
}

func NewQueue[T any]() Queue[T] {
	return Queue[T]{}
}
